package com.zheng.springcloud.service;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.zheng.springcloud.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;

/**
 * {@code @FeignClient(value = "provider-dept")}表明是谁提供的服务
 * {@code @RequestMapping("/dept/add")}表明远程调用的服务接口
 * @author lenovo
 */
@FeignClient(value = "provider-dept",fallbackFactory = DeptFallback.class)
public interface DeptService {
    @RequestMapping("/dept/add")
    public boolean addDept(Dept dept);
    @RequestMapping("/dept/get/{id}")
    public Dept get(@PathVariable("id")int id);
    @RequestMapping("/dept/list")
    public ArrayList<Dept> select();
}
